package test.module;

import org.apache.commons.lang3.time.StopWatch;
import org.junit.After;
import org.junit.Before;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;

/**
 * 计时器测试基类
 * @author George
 *
 */
@ContextConfiguration(locations = {
		"classpath*:/applicationContext-busi-*.xml",
		"classpath*:/applicationContext-resource-*.xml",
		"classpath:/applicationContext-aspect.xml", 
		"classpath:/security-shiro.xml",
		"classpath:/email/applicationContext-mail.xml"
})
@ActiveProfiles("test")
public abstract class AbstractTimerTestSupport extends AbstractJUnit4SpringContextTests {
	
	protected StopWatch watch;
	
	protected transient Logger log = LoggerFactory.getLogger(this.getClass());

	@Before
	public void setUp(){
		log.debug("initializing stop watch...");
		watch = new StopWatch();
	}
	
	@After
	public void tearDown(){
		log.debug("trying to release stop watch...");
		watch = null;
	}
}
